"""
    目标：
        driver.find_elements()
"""
# 导包
from selenium import webdriver
from time import sleep

from selenium.webdriver.common.by import By

# 获取 浏览器对象
driver = webdriver.Chrome()

# 打开注册A.html
url = r"D:\python\python-selenium-learn\a02_元素定位方式\learn-files\注册A.html"
driver.get(url)

# 获取所有的input元素
# elements = driver.find_elements(By.TAG_NAME, "input")

elements = driver.find_elements(By.ID, "userA")
print(len(elements))
print("elements的类型为：", type(elements))

# 输入内容
elements[0].send_keys("admin")

# 通过遍历来输入
for el in elements:
    el.send_keys("admin")

# 暂停3秒
sleep(3)

# 退出浏览器驱动
driver.quit()



